// services/llm/deepseek.js
const axios = require('axios');
const config = require('../../config');

class DeepSeekService {
    async call(prompt, options = {}) {
        const response = await axios.post(
            config.deepseek.apiUrl,
            {
                model: "deepseek-chat",
                messages: [{ role: "user", content: prompt }],
                temperature: options.temperature || 0.3,
                max_tokens: options.max_tokens || 2000
            },
            {
                headers: {
                    'Authorization': `Bearer ${config.deepseek.apiKey}`,
                    'Content-Type': 'application/json'
                }
            }
        );
        return this._extractContent(response);
    }

    _extractContent(response) {
        return response.data.choices[0].message.content;
    }
}

module.exports = new DeepSeekService();